package cn.java86.test2;

import cn.java86.dao.GradeDao;
import cn.java86.dao.StudentDao;
import cn.java86.entity.Grade;
import cn.java86.entity.Student;
import cn.java86.util.MybatisUtil;
import cn.java86.util.StrUtil;
import org.apache.ibatis.session.SqlSession;

/**
 * @author oldliu
 * @since 1.0
 */
public class TestGrade {
    public static void main(String[] args) {
        SqlSession s= MybatisUtil.get();
        GradeDao mapper = s.getMapper(GradeDao.class);
        Grade grade = mapper.get(5L);
        System.out.println("年级信息如下:");
        System.out.println(grade);
        System.out.println("学生信息如下:");
        for(Student st:grade.getStus()){
            System.out.println(st);
        }
        MybatisUtil.close(s);
    }
}
